<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <!-- 鸡兔同笼：鸡和兔子一共35只，笼子里一共有94只脚，
        用程序计算出鸡和兔子分别多少只 -->

    <script>
        
        for(var i = 0; i <= 35;i++){
            for (var j = 0; j <= 35; j++){
                if(i*2 + j*4 == 94 && i+j == 35){
                    document.write("鸡有" + i + "只" + "<br>");
                    document.write("兔子有" + j + "只");

                }
            }
        }

    </script>


</body>
</html>